package com.will.txj.aj.security.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: wen-yi;
 * @date: 2021/12/5 10:36;
 * @Description: 监听器配置
 */
@Configuration
public class ListenerConfig {
    @Autowired
    private SessionListener sessionListener;
    @Autowired
    private ContextListener contextListener;

    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean() {
        ServletListenerRegistrationBean slrBean = new ServletListenerRegistrationBean();
        slrBean.setListener(sessionListener);
        slrBean.setListener(contextListener);
        return slrBean;
    }
}
